import request from "@/uitls/request";
import { logfromType, logfromDate, userInfoData } from "./type";
// 项目用户相关的请求地址
enum API {
  LOGIN_URL = "/admin/acl/index/login",
  USERINFO_RUL = "/admin/acl/index/info",
  LOGOUT_RUL = "/admin/acl/index/logout",
  USER_MENU = "/admin/acl/index/menu",
}

// 登录接口
export const reqLogin = (data: logfromType) =>
  request.post<any, logfromDate>(API.LOGIN_URL, data);
// 获取用户信息
export const reqUserInfo = () =>
  request.get<any, userInfoData>(API.USERINFO_RUL);
// 退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT_RUL);
// 获取用户菜单
export const reqUserMenu = (data: any) =>
  request.get<any, any>(API.USER_MENU, data);
